home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
090
/
pctj0987.arc
/
COMPLEX.C
next >
Wrap
Text File
|
1987-07-02
|
2KB
|
80 lines
/*
* COMPLEX -- PC Tech Journal Laser Printer Page Complexity Test
*
* Version 1.0
*
* Copyright (c) 1987, Ziff Communications Company
* Program by: Rainer McCown
* This routine tests the level of complexity which the printer can
* handle. It draws a large number of vertical rules on the page.
* The rules start at various vertical offsets gradually increasing
* the complexity to beyond the limit of the HP printer.
*/
#include "io.h"
#include "string.h"
#include "fcntl.h"
#define STD_OUT 1
extern void sndl(char [], int),
snd (char []),
setbinary(int);
/****************************** MAIN *******************************/
void main()
{
int cnt;
char *txt, *p1, *p2;
/* Change STD_OUT to binary mode to avoid
converting LFs to CR,LF and to avoid
stopping on EOFs */
setbinary(STD_OUT);
/* Initialize the printer */
snd("\x1BE"); /* Reset the printer */
snd("\x1B&l0O"); /* Portrait mode */
/* Position the cursor and draw a vertical rule */
txt = "\x1B*p???0x!!!0Y\x1B*c1a1900b0P";
p1 = strchr(txt, '?'); /* Point to 1st fill location */
p2 = strchr(txt, '!'); /* Point to 2nd fill location */
for (cnt = 1; cnt <= 109; cnt++)
{
/* Format the first fill location with leading zeros */
sprintf(p1, "%03u", cnt);
p1[3] = '0'; /* Overwrite SPRINTF terminating zero */
sprintf(p2, "%03u", cnt);
p2[3] = '0'; /* Overwrite SPRINTF terminating zero */
snd(txt); /* Send to the printer */
}
for (cnt = 111; cnt <= 219; cnt++)
{
/* Format the first fill location with leading zeros */
sprintf(p1, "%03u", cnt);
p1[3] = '0'; /* Overwrite SPRINTF terminating zero */
sprintf(p2, "%03u", cnt - 110);
p2[3] = '0'; /* Overwrite SPRINTF terminating zero */
snd(txt); /* Send to the printer */
}
/* Eject page */
snd("\f");
} /* End MAIN */